import { useState } from 'react'
import {MyModal } from '../Component/MyModal'
import { Button,} from 'antd'


function TestView(){
 const [visible,setVisible] =  useState(false)
 
  // 弹窗信息
  const modalParam = ()=>{
    return {
      visible:visible,
      onCancel,
      onOk,
    }
  }


  // 弹窗事件 
  const onCancel =()=>{
    setVisible(false)
  }

  const onOk = ()=>{
    onCancel()
  }
  




  return(
    <div>
      test my component dome  
     <MyModal  {...modalParam()}>
        弹出里的内容
      </MyModal> 
  {/* 
      <ModalFanc  {...modalParam()}>
      弹出里的内容
      弹出里的内容
      弹出里的内容

      </ModalFanc>
  
  */}
      <Button type='primary' onClick={()=>setVisible(!visible)}>弹出</Button>
    </div>
  )
}

export default TestView